﻿using System;

namespace machines_main
{
    class TestArgs
    {
        public const short FLAG_VERBOSE = 0x1;
        public const short FLAG_QUIET = 0x2;
        public const short FLAG_INVALID = 0x4;
        public const short FLAG_HELP = 0x8;

        private short flags;

        public TestArgs()
        {
            flags = 0;
        }

        public TestArgs(short _flags)
        {
            flags = _flags;
        }

        public static explicit operator short(TestArgs args)
        {
            return args.flags;
        }

        public bool Invalid
        {
            get { return ((flags | FLAG_INVALID) == flags); }
            set { if (value ^ Invalid) flags ^= FLAG_INVALID; }
        }

        public bool Verbose
        {
            get { return ((flags | FLAG_VERBOSE) == flags); }
            set { if (value ^ Verbose) flags ^= FLAG_VERBOSE; }
        }

        public bool Quiet
        {
            get { return ((flags | FLAG_QUIET) == flags); }
            set { if (value ^ Quiet) flags ^= FLAG_QUIET; }
        }

        public bool Help
        {
            get { return ((flags | FLAG_HELP) == flags); }
            set { if (value ^ Help) flags ^= FLAG_HELP; }
        }
    }
}
